First we need to import the 'physcon' module. If necessary this can be obtained from: http://www.hjcb.nl/python/physcon.html


In [1]:
import physcon as ps

In [2]:
ps.help()


Available functions:
[note: key must be a string, within quotes!]
  value(key) returns value (float)
  sd(key)    returns standard deviation (float)
  relsd(key) returns relative standard deviation (float)
  descr(key) prints description with units

Available global variables:
  alpha, a_0, c, e, eps_0, F, G, g_e, g_p, gamma_p, h, hbar, k_B
  m_d, m_e, m_n, m_p, mu_B, mu_e, mu_N, mu_p, mu_0, N_A, R, sigma, u

Available keys:
['alpha', 'alpha-1', 'amu', 'avogadro', 'bohrmagn', 'bohrradius', 'boltzmann', 'charge-e', 'conduct-qu', 'dirac', 'elec-const', 'faraday', 'gas', 'gfactor-e', 'gfactor-p', 'gravit', 'gyromagratio-p', 'josephson', 'lightvel', 'magflux-qu', 'magn-const', 'magnmom-e', 'magnmom-p', 'magres-p', 'mass-d', 'mass-d/u', 'mass-e', 'mass-e/u', 'mass-mu', 'mass-mu/u', 'mass-n', 'mass-n/u', 'mass-p', 'mass-p/u', 'nuclmagn', 'planck', 'ratio-me/mp', 'ratio-mp/me', 'rydberg', 'stefan-boltzm']

In [3]:
ps.m_e


Out[3]:
9.10938291e-31

We can also obtain the value for the speed of light in vacuo (c)


In [4]:
ps.c


Out[4]:
299792458.0

We can then work out the energy equivalence of an electron at rest:


In [5]:
energy = ps.m_e * ps.c * ps.c

and then divide by 1.6 x 10^16 to give an answer in keV:


In [6]:
energy/1.6e-16


Out[6]:
511.69406659119755

In [18]: